<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>人员列表</title>
    <link href="../../../css/common.css" rel="stylesheet"/>
    <link href="../../../css/mui.min.css" rel="stylesheet"/>
    <link href="../../../css/order/dispatcher/orderHistory.css" rel="stylesheet"/>
    <script src="../../../js/vue.min.js"></script>
    <script src="../../../js/mui.min.js"></script>
    <script src="../../../js/fastclick.js"></script>
    <script src="../../../js/api.js"></script>
    <script src="../../../js/common.js"></script>
    <script src="../../../js/vue-common.js"></script>
    <script src="../../../js/vue-compents/dispatcher.js"></script>
    <style>
        #app, html, body {
            height: 100%;
            overflow: hidden;
        }
    </style>
</head>
<body>
<div id="app">
    <div class="header-nav person-nav">
        <div class="nav-search-box"><input onkeydown="if(event.keyCode==13){vm.initList();}" v-model="name"
                                           class="nsb-input" type="text" placeholder="请输入查询条件"></div>
        <div class="icon"><img src="../../../img/common/btn_back.png" alt=""></div>
    </div>

    <div class="container person-container">
        <div v-for="groupItem of list" class="card-line-box">
            <div class="cli-title">{{groupItem.tenantName}}</div>
            <user-line-item v-for="item of groupItem.list" :data="swiftPersonInfo(item)"></user-line-item>
        </div>


        <!--<div  class="card-line-box">-->
        <!--<div class="cli-title">地堡</div>-->
        <!--<user-line-item v-for="item of topp" :data="swiftPersonInfo(item)"></user-line-item>-->
        <!--</div>-->

        <div v-show="noDataShow"  class="order-his-no-data">
        --暂无--
        </div>
    </div>
</div>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            list: [],
            // 0 （未派工）1 （已派工）
            type: 0,
            name: '',
            topp: [{
                name: '23',
                icon: '',
                phone: '234242',
                status: '1'
            }, {
                name: '23',
                icon: '',
                phone: '234242',
                status: '1'
            }]
        },
        computed: {
            noDataShow: function () {
                return this.list.length === 0;
            }
        },
        methods: {
            initList: function () {
                Resource.get(DISPATCHER_PERSION_LIST, {pageNo: 1, pageSize: 1000, name: this.name}, function (res) {
                    vm.list = res.list;
                })
            },
        }

    });

    function swiftPersonInfo(data) {
        var result = {
            name: data.name,
            icon: data.icon,
            phone: data.phone,
            status: data.workStatus
        }
        return result;
    }

    mui.plusReady(function () {
        vm.initList();
    })


</script>
</body>
</html>